<template>
  <div id="container"></div>
</template>

<script>
export default {
  mounted() {
    window.onLoad = function () {
      var map = new AMap.Map("container", {
        zoom: 11, //级别
        // center: [116.397428, 39.90923], //中心点坐标
        viewMode: "3D", //使用3D视图
      });
      var marker = new AMap.Marker({
        // position: new AMap.LngLat(116.39, 39.9), // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
        title: "北京hha",
      });
      map.add(marker);
    };
    var url =
      "https://webapi.amap.com/maps?v=1.4.15&key=b81b24ed62040e54fef30ee332ced41e&callback=onLoad";
    var jsapi = document.createElement("script");
    jsapi.charset = "utf-8";
    jsapi.src = url;
    document.head.appendChild(jsapi);
  },
};
</script>

<style lang="less" scoped>
#container {
  width: 600px;
  height: 400px;
}
</style>